package com.example.knowledgeget1.KnowtCommon.Repository;

import com.example.knowledgeget1.KnowtCommon.Entity.Like;
import com.example.knowledgeget1.KnowtCommon.Entity.LikeId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface LikeRepository extends JpaRepository<Like, Long> {
    boolean existsById(LikeId id);

    // 根据knowId删除like实体
    @Transactional
    void deleteById_KnowId(Long knowId);
}